<!--
 * @Description:
 * @Autor: zhangqj
 * @Date: 2021-01-21 11:47:37
 * @LastEditors: zhangqj
 * @LastEditTime: 2021-03-26 15:56:44
-->
<template>
  <!-- 选平台 start -->
  <div class="plattabs">
    <span
      v-for="(item, ind) in platList"
      :key="ind"
      :class="platIndex === ind ? 'activetab' : ''"
      @click="platClick(item, ind)"
    >{{ item.label }}</span>
  </div>
</template>

<script>
export default {
  name: 'PlatTabs',
  props: {
    platIndex: {
      type: Number,
      default: 0
    },
    platList: {
      type: Array,
      default() {
        return []
      }
    }
  },
  methods: {
    // 平台选择
    platClick(item, ind) {
      this.$emit('platClick', item, ind)
    }
  }
}
</script>

<style lang="scss" scoped>
.plattabs {
  position: absolute;
  right: 184px;
  top: 77px;
  z-index: 99;
  span {
    display: inline-block;
    color: #999999;
    width: 24px;
    height: 16px;
    font-size: 12px;
    line-height: 16px;
    text-align: center;
    margin-left: 24px;
    cursor: pointer;
    position: relative;
    &:hover {
      color: #ff0929;
    }
  }
  .activetab {
    color: #ff0929;
    &::before {
      content: '';
      width: 16px;
      height: 1px;
      background: #ff0929;
      border-radius: 1px;
      position: absolute;
      bottom: -2px;
      left: 4px;
    }
  }
}
</style>
